package com.mgface.framework.client.filter;

import java.io.IOException;

import javax.ws.rs.client.ClientRequestContext;
import javax.ws.rs.client.ClientRequestFilter;

import com.mgface.framework.client.User;

public class ClientRequestFilterWrapper implements ClientRequestFilter {

	public void filter(ClientRequestContext requestContext) throws IOException {
		String method = requestContext.getMethod();
		if("POST".equals(method)&&requestContext.hasEntity()){
			User user = (User)requestContext.getEntity();
			String modify = "mgface."+user.getUserId();
			user.setUserId(modify);
			requestContext.setEntity(user);
		}
	}

}
